﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UserSystemApi.Entity;

namespace UserSystemApi.Core
{
    public class UserSystemContext:DbContext
    {
        public UserSystemContext() { }
        public UserSystemContext(DbContextOptions<UserSystemContext> options):base(options)
        {
        
        
        } 
        public DbSet<Users> Users { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                optionsBuilder.UseMySql("server=localhost;uid=root;pwd=1234;port=3306;database=Userdb", MySqlServerVersion.LatestSupportedServerVersion);
            }
           
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
    }
}
